package com.bw.dao;

import com.bw.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/***************************
 FileAction: 提供对用户表增删改查操作的

 CreateTime:2022-08-23 9:06
 Author:Aaking-aline
 ****************************/
public interface UserDao {

	@Insert("insert into user(username,password,join_time) values(#{username},#{password},#{joinTime})")
	void insertUser(User user);

	@Delete("delete from user where id = #{id}")
	void deleteUser(String id);

	@Update("update user set username = #{username},password = #{password},join_time = #{joinTime} where id = #{id}")
	void updateUser(User user);

	@Select("select * from user")
	List<User> selectAllUser();

	@Select("select * from user where join_time >= #{beg} and join_time <= #{end}")
	List<User> selectUserRange(@Param("beg") String begin,@Param("end") String end);

}
